Skip to content

fix(console): under draft preview the New record form draws a draft-only field and never writes it - #34843

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-34807-draft-preview-form-list
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-34807-draft-preview-form-list

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX

Part of #34807
Clause-②: no
Metadata-protocol: none
Premise corrected: 6946635368
Ruling-ref: 6946403206
Surface-amendment: 6949282066
Review-ref: 6950630501

This PR ships the form half of the card. The list half (a draft list column on a draft-only field gets the list query refused) stays on the card: the console list query is sent by ListView in @object-ui/plugin-list, outside this PR's surface, and the seat is deciding how it lands.

维护者速读

  • 改了什么:草稿预览(?preview=draft)里,「新建记录」整页表单和全局新建/编辑弹窗现在会显示只存在于草稿中的字段(用草稿里的标签和定义),但该字段是灰的、不可填写,也不算必填(草稿里标了必填也不会挡住保存);保存时这些字段也不会写入记录。
  • 为什么改:AI 在抽屉里给应用加了字段,进入草稿预览后新建表单却看不到它,用户会以为 AI 没做成;改成「看得见、填不了」,既让预览可信,又不让用户白填一个不会被保存的值。
  • 风险与回滚:只在预览模式下生效;预览之外表单拿到的仍是原来的 adapter 本身,plugin-form 只多认一个预览专用标记,没有标记的字段行为不变。回滚即 revert 本 PR。
  • 先看:ui/packages/plugin-form/src/sectionFields.ts 与 ObjectForm.tsx(disabled 那一行多了 _draftOnly 判断,影响已发布包);ui/packages/app-shell/src/utils/previewFormDataSource.ts(withDraftOnlyFields 与代理的 create/update 剔除);ui/packages/app-shell/src/views/RecordFormPage.tsx(只换了传给表单的 dataSource)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/utils/previewFormDataSource.test.tsx packages/app-shell/src/views/RecordFormPage.draftPreview-34807.test.tsx packages/plugin-form/src/sectionFields.test.ts packages/plugin-form/src/ObjectForm.test.tsx,预期 4 个文件、70 个测试全部通过。
  • 需要你做的:无,席位落地。

What changes

  • New ui/packages/app-shell/src/utils/previewFormDataSource.ts:
    • withDraftOnlyFields(published, overlay): a copy of the published object document plus each field only the draft overlay declares, with its draft definition minus required / requiredWhen, and the marker _draftOnly: true (spelled in the module as DRAFT_ONLY_FIELD_KEY). A disabled control the form still requires would refuse every save over a field the viewer cannot fill (review 6950630501, M1). Fields the published document declares keep their published definition. The copy re-attaches the adapter's non-enumerable sortability projection with attachObjectSortability (a spread drops it). A draft-only object (published read answers MetadataNotFoundError) yields the overlay with every field marked; no overlay document returns the published one as is.
    • readDraftPreviewObjectSchema(adapter, readOverlay, name): the overlay read (useMetadata().getItem('object', name), which reads through the ?preview=draft client in preview) over the adapter's published getObjectSchema. Any published failure other than absence fails the read, as today.
    • createPreviewFormDataSource(adapter, readOverlay): a Proxy over the adapter whose getObjectSchema answers the above and whose create / update leave the draft-only names that answer marked out of the record they send (a safety net: the field is not fillable, but its declared default would otherwise ride along). Every other member is the adapter's own, bound to it once (stable identity).
    • usePreviewFormDataSource(adapter): the adapter itself outside preview; the proxy inside it.
  • @object-ui/plugin-form: the disabled line in ObjectForm's generateField and in the shared object-schema field mapping fromObjectSchema (sectionFields.ts) gains || field._draftOnly === true. In normalizeSectionField a form-view entry's required no longer applies when the object-schema field carries _draftOnly: true (the view entry carries no requiredWhen on that path); the field stays disabled. The literal is spelled in each package; nothing new is exported.
  • RecordFormPage passes usePreviewFormDataSource(dataSource) to ObjectForm; claimAnswerWarnings keeps the raw adapter. Its comment now says the draft-only field is drawn disabled and the proxy leaves it out of every create and update (review S1, 6949215692: fixed).
  • AppContent passes it to the global LazyModalForm (call-site change only).
  • The write census in affordanceGrantMap-12082.test.tsx (WRITE_SITES) gains the proxy's create and update as door(...) entries, with the reason: it forwards the write its form hands it, minus draft-only field names.
  • No change to ModalForm, plugin-grid, plugin-list, preview/** or packages/**. No new locale key.

Why

Under ?preview=draft the form's field names came from the draft-aware metadata provider, but its field definitions came from the adapter's published getObjectSchema, which carries no preview flag; ObjectForm draws only a name its definition declares, so a draft-only field was missing (premise reading 6946388533, corrected by the seat in 6946635368).

Disabled, not readonly, and not editable-then-stripped (surface amendment 6949282066, route A). Preview stays read-only for data (ruling 6946403206, ADR-0037 Phase 1): a draft-only field does not exist in the published object the data door validates against, so it must never be written. A field drawn editable and then silently stripped was rejected by the seat. Marking the definition readonly: true does not work: measured on this head, filterSystemFields in @object-ui/plugin-form drops any readonly: true field on create and edit, and a create form does not evaluate readonlyWhen (readonlyWhen: isCreateForm ? undefined : readonlyWhen in the components form renderer), so a static lock hides the field the preview exists to show and a predicate lock does nothing. (Correction: an earlier revision of this body named that filter filterCreateModeFields; the function is filterSystemFields.) The renderer does honour FormField.disabled on create, so plugin-form maps the marker to disabled.

Disabled, therefore not required (review 6950630501, M1). isRequiredInForm keeps required at both plugin-form mapping sites, the form renderer never lowers required for a disabled control, and react-hook-form still validates it, so a draft that adds a required field with no default made New refuse with "X is required" over a control the viewer cannot fill (reproduced: the ablation below). The marked copy therefore drops the field's required and requiredWhen, in app-shell. A form view could restate required over the field (normalizeSectionField re-runs isRequiredInForm on the view entry's own required, and under preview the form view comes from the draft object), so that restatement is skipped for a _draftOnly field in sectionFields.ts (fix round 4, option A). The field's value rules (minLength, maxLength, min, max, and the email / url / location checks its type implies) are kept: they fire only on a value, and the only value a disabled draft-only control holds is its own draft default, so they could refuse only a draft whose default breaks its own rule.

Deviation, declared. _draftOnly is an underscore-private convention between two of our packages (@object-ui/app-shell sets it, @object-ui/plugin-form reads it), not an authoring key: no spec schema, no metadata document and no author ever writes it, it is never persisted, and only the console's draft-preview proxy produces it. Hence Clause-②: no and Metadata-protocol: none.

Tests

  • ui/packages/plugin-form/src/sectionFields.test.ts: "a _draftOnly field maps to a disabled FormField": the marked field is disabled; CONTROL: the same field unmarked is not. A form-view entry { field: 'priority', required: true } over the marked field gives required: false, disabled: true; CONTROL: the same entry over an unmarked field gives required: true.
  • ui/packages/plugin-form/src/ObjectForm.test.tsx: "ObjectForm draws a _draftOnly field disabled": through the real ObjectForm, the marked field's input is disabled; CONTROL: the unmarked field stays editable.
  • ui/packages/app-shell/src/utils/previewFormDataSource.test.tsx (17 tests): a required draft-only field (required: true, no default) and a requiredWhen one, through the real ModalForm under preview: both drawn disabled, Save goes through, the create has neither key; withDraftOnlyFields drops required / requiredWhen from a draft-only field and keeps a published field's required; CONTROL outside preview: a required published field left empty still blocks Save (aria-invalid, no create). Also withDraftOnlyFields (marker, published definitions kept, inputs untouched, sortability projection survives, draft-only object, no overlay); the proxy (overlay answer, absence vs other failure, create/update strip, this binding / identity / instanceof); the hook (CONTROL: outside preview it is the adapter; in preview it reads getItem('object', name)); the real ModalForm under preview: "Priority" visible and its input disabled, "Title" editable, Save's create payload has title and no priority (its declared default is stripped too); CONTROL outside preview: one getObjectSchema('tracker_task') call, getItem never called, no "Priority".
  • ui/packages/app-shell/src/views/RecordFormPage.draftPreview-34807.test.tsx (4 tests): the real RecordFormPage + ObjectForm under preview with a required draft-only field: drawn disabled, Save goes through, the create leaves it out. With a draft form view whose section restates { field: 'due_note', required: true } on the draft-only field: drawn disabled, Save goes through, the create leaves it out. Also the real RecordFormPage + ObjectForm under preview: "Priority" visible and disabled, absent from the create; CONTROL outside preview: one published read (objectui#13044), no overlay read, no draft field.
Pinned files plus the census, head 75e7773
pnpm --dir ui exec vitest run --maxWorkers=2 (previewFormDataSource.test.tsx, RecordFormPage.draftPreview-34807.test.tsx, ObjectForm.test.tsx, sectionFields.test.ts, affordanceGrantMap-12082.test.tsx)
 Test Files  5 passed (5)
      Tests  125 passed (125)
os-verify-lock: VERDICT command-exit 0
Ablation (one-shot, restored): the form-view required skip removed from normalizeSectionField

Committed first (75e7773); node scripts/ablation-replace.mjs replaced if (fd.required != null && !draftOnly) { with if (fd.required != null) { (anchor x1 to x0, blob f1a74df5666d to 199e51e13a0e), ran sectionFields.test.ts, RecordFormPage.draftPreview-34807.test.tsx and previewFormDataSource.test.tsx, restored.

FAIL sectionFields.test.ts > a `_draftOnly` field maps to a disabled FormField > a form view restating `required: true` does not make the marked field required; it stays disabled
FAIL RecordFormPage.draftPreview-34807.test.tsx > RecordFormPage under draft preview > a draft form view restating `required` on the draft-only field does not block Save
 Test Files  2 failed | 1 passed (3)
      Tests  2 failed | 59 passed (61)
ablation-replace: ok restored: blob == HEAD (f1a74df5666d) and `git diff HEAD` is empty

The CONTROL (the same view entry over an unmarked field stays required) stayed green under the mutation.

Ablation (one-shot, restored): the required drop reverted in withDraftOnlyFields

Committed first (1bb765d); node scripts/ablation-replace.mjs put back the pre-fix copy, fields[name] = { ...def, [DRAFT_ONLY_FIELD_KEY]: true }; for { ...drawn, ... } (anchor x1 to x0, blob 7795004bb009 to 96c69503085d), ran the two app-shell files, restored.

FAIL previewFormDataSource.test.tsx > withDraftOnlyFields > a draft-only field drops required and requiredWhen; a published field keeps its own
FAIL previewFormDataSource.test.tsx > the global New modal under draft preview > a REQUIRED draft-only field is drawn disabled and does not block Save; the create leaves it out
FAIL RecordFormPage.draftPreview-34807.test.tsx > RecordFormPage under draft preview > a REQUIRED draft-only field is drawn disabled and does not block Save; the create leaves it out
 Test Files  2 failed (2)
      Tests  3 failed | 17 passed (20)
ablation-replace: ok restored: blob == HEAD (7795004bb009) and `git diff HEAD` is empty

The outside-preview CONTROL (a required published field still blocks) stayed green under the mutation.

Ablation (one-shot, restored): the marker dropped from the plugin-form field mapping

Committed first (03c259d); node scripts/ablation-replace.mjs removed || field._draftOnly === true from fromObjectSchema in sectionFields.ts (anchor x1 to x0, blob 0775f5a75bf2 to 69e117962018), ran sectionFields.test.ts and previewFormDataSource.test.tsx, restored.

FAIL sectionFields.test.ts > a `_draftOnly` field maps to a disabled FormField > the marked field is disabled
FAIL previewFormDataSource.test.tsx > the global New modal under draft preview > draws the draft-only field disabled, and Save leaves it out of the create
 Test Files  2 failed (2)
      Tests  2 failed | 50 passed (52)
ablation-replace: ok restored: blob == HEAD (0775f5a75bf2) and `git diff HEAD` is empty

The unmarked CONTROLs and the outside-preview CONTROLs stayed green under the mutation. An earlier ablation (head 1f10163) reverted the proxy's getObjectSchema to the adapter's read: 6 failed | 10 passed, restored blob == HEAD.

Write census: red, then green

At 03c259d CI's Test UI failed affordanceGrantMap-12082.test.tsx > "every write site in the tree has an entry, and every entry is a site in the tree" (the proxy's create / update were unlisted). Reproduced locally in the targeted run: Tests 1 failed | 3405 passed | 1 skipped (3407), the one failure being that test. After the two door(...) entries: that file Tests 55 passed (55), VERDICT command-exit 0; committed as 9719bf9.

Acceptance notes

  • Draft edits to a field the published object already declares (a relabel, a new option) are not shown: those fields keep their published definition so what the form validates and writes is what the data door accepts. Only draft-only fields come from the overlay.
  • A draft-only field's value rules are kept (see Why): they could refuse only a draft whose own default breaks its own rule.
  • A master-detail form that persists through submitHandler (not dataSource.create/update) is not covered by the payload strip; the field is still drawn disabled there if that form maps through fromObjectSchema; no draft-only path into it was found, not measured.
  • Out of scope, noted not filed (read inference, not reproduced): RecordFormPage turns every query-string entry into a create prefill, so on a New page under ?preview=draft the pair preview=draft becomes a prefill value; the write sanitizer drops it as an unknown key unless the object declares a field named preview.
  • The list half stays on Draft preview: a field that exists only in the draft is missing from the New record form, and a draft list column on it makes the list query refused #34807 (see the top of this body).

Verification

Targeted run, head 03c259d: all of packages/plugin-form/ plus every app-shell test file that imports RecordFormPage, AppContent or the new helper, and the 13044 one-read pin
pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-form/ (+ 80 app-shell files)
 Test Files  1 failed | 316 passed (317)
      Tests  1 failed | 3405 passed | 1 skipped (3407)

The one failure was the write census, fixed in 9719bf9 (see above). Declared narrowing: the full packages/app-shell/ suite ran over 40 minutes on the shared box earlier and was stopped by me before a verdict; it is NOT MEASURED locally and left to CI's Test UI.

Type-check and lint
pnpm --filter @object-ui/plugin-form run type-check and @object-ui/app-shell run type-check -> 0 error TS, VERDICT command-exit 0 (head 03c259dcff; both re-run on 75e777380d: 0 error TS, VERDICT command-exit 0)
npx eslint --no-inline-config (the changed .ts/.tsx files) -> 0 errors, 177 warnings (pre-existing lines); on 75e777380d's three changed files: 0 errors, 48 warnings
pnpm --dir ui run check:new-line-citations (head 9719bf9810) -> VERDICT new-cross-file-line-citations: 0 new citation(s)
Derived gate families (dispatch-gates --commands, 38), --ran reconciliation

Re-derived at 75e7773: the same 38 families. Re-run on 75e7773 (the families reading the changed changeset, source and test files): check-empty-changeset, check-adr-0087-registration, check-changeset-no-major, check:nul-bytes, check:cross-package-test-inputs, check:undeclared-dep-imports, check:type-check-coverage, check:test-source-alias, check-sdui-manifest, check:skill-identifier-liveness, all exit 0; check:new-line-citations 0 new. Earlier, at 9719bf9: All 38 exited 0 (run over 03c259d plus the census entry; pnpm --dir ui exec vitest run scripts/ first missed the lock, exit 99, and was re-run: Test Files 171 passed | 2 skipped (173), Tests 5077 passed | 2 skipped (5079), VERDICT command-exit 0). dispatch-gates --ran: 38 derived, 38 run, 0 NOT-MEASURED (a derived zero: all 38 recorded an exit code).

  • Build closure: pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build, VERDICT command-exit 0.
  • node scripts/pm/overlap-check.mjs --branch=claude/issue-34807-draft-preview-form-list, alone before every push: VERDICT clean exit 0 (last: 75e7773 vs origin/main fc5913e and PR feat(studio): switch an installed app's action on or off on the action, in Studio; retire Setup's Packaged Actions #34799, which shares AppContent.tsx, merges cleanly).
  • Changeset .changeset/34807-draft-preview-form-fields.md: @object-ui/app-shell patch and @object-ui/plugin-form patch.
  • NOT MEASURED: a live run on com.example.tracker under ?preview=draft; the AppContent modal call site rendered inside the full console (the hook and the real ModalForm are pinned together, the call site itself is a one-prop change); the full app-shell suite (CI); dogfood (n/a: no ! in the title, no narrowing arm).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (No formatter ran. eslint on the changed files: 0 errors; the repo-wide pnpm lint is CI's, not measured locally.)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX


Generated by Claude Code

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB

L1 review · 2026-11-17T13:18Z

L1: ACCEPT
Head-sha: 1f10163

Read at this exact head: the 6 files (+575/−2), the body, card #34807, ruling 6946403206, Premise corrected 6946635368, claim 6946453254, and os-dev-report 6949123927. check-governed-merges: not governed, 577 lines.

CI on this sha at review time: 49 runs. None had failed; Test UI (16 shards), Lint UI, Type Check UI, Build & E2E UI and most Lint/Type Check jobs were still in progress. The full app-shell suite is NOT MEASURED locally (the report says so). CI's Test UI is therefore the only whole-suite reading, and it must be green before landing.

Landing condition (nit-only standard): S1 below is fixed and delta-reviewed, and the seat accepts the declared deviation (E1). Until both hold, this PR is not landable.

Must-fix

None.

Should-fix

  • S1: a comment this PR adds states the design it did not ship. ui/packages/app-shell/src/views/RecordFormPage.tsx (the new block above usePreviewFormDataSource) says "the form reads its object definition through the draft overlay (draft-only fields read-only)". The helper draws them editable and strips them from create/update (previewFormDataSource.ts module doc, the "⛔ The field is not locked instead" paragraph). The comment's next sentence, "Writes … stay on the adapter", is also off for the form. The form's create/update now go through the proxy, which drops the marked names before calling the adapter. Only claimAnswerWarnings keeps the raw adapter. Reword it to match the helper, for example "draft-only fields drawn editable and left out of every write; claimAnswerWarnings below keeps the raw adapter".

Escalated to the seat

  • E1: the deviation from the seat's order. Premise corrected 6946635368, step 1, names the mechanism: mark draft-only fields read-only so the write sanitizer keeps them out of Save. The PR instead draws them editable and strips them in the proxy. The measurement behind it holds as read: filterCreateModeFields drops a readonly: true field on create, so a lock would hide the field. The contract outcome is the same, because a draft-only value is never written and the data plane is untouched. The viewer-facing behavior differs, though: a value the viewer types is accepted and then silently dropped on Save. That is the seat's call, not L1's.

Checklist

  • Shape: draft, Part of #34807. The list half stays on the card under the new claim 6949175867, which is correct for a split. Both declaration lines are Clause-②: no / Metadata-protocol: none, matching claim 6946453254. No published package's exports change: the helper is app-shell internal, and _draftOnly is an undeclared key on an untyped value, as amendment 6946712960 allows.
  • Surface: the helper sits under ui/packages/app-shell/src/utils/. RecordFormPage.tsx and the AppContent modal call site are call-site-only edits. There are 2 new tests beside them and the changeset. All of this is inside the claim. ObjectForm.tsx/ModalForm.tsx are untouched, which is narrower than the claim allows. No preview/** or packages/** edit. No unrelated files.
  • Changeset: one @object-ui/app-shell patch, the only package whose src moved.
  • Change, read through:
    • The form writes go through the prop that now carries the proxy: ObjectForm.tsx:1352 and ModalForm.tsx:843 call dataSource.create(...). The strip map is filled by the same proxy's getObjectSchema, which both forms call before they can submit.
    • The published definitions win for fields both documents declare. A draft-only object (published read absent through MetadataNotFoundError) marks every field. Any other published-read failure rethrows, as without preview. Sortability is re-attached.
    • Outside preview, usePreviewFormDataSource returns the adapter itself, and the RecordFormPage CONTROL pins exactly one getObjectSchema call (objectui#13044).
    • getItem is a useCallback over [readItem, readPackagedItem] (MetadataProvider.tsx:1424), so the memoized proxy is not rebuilt each render. Delegated members are bound once, so their identity is stable.
  • Tests: the commands are real. The 2 new files pass 16 tests, and a targeted run of 80 files passes 749 tests. The real ModalForm and real RecordFormPage+ObjectForm under preview draw Priority, and the create payload has no priority even after typing. The ablation of the proxy's schema read turns 6 tests red while both controls stay green, and the restore is blob-verified.
  • Acceptance (form half): met as specified. A draft list column remains for the list half.
  • Docs made false: none found. git grep over content/docs and docs/adr shows no form-under-preview text. ADR-0037 Phase 1 ("data plane untouched") holds.
  • UI strings: none added.

Notes

  • N1: A draft-only field the draft declares required: true blocks Save until it is filled, and the value is then dropped. This follows from E1 and is worth one line in the PR body if the seat keeps the editable route.
  • N2: Draft edits to already-published fields (a changed label, a new required) are not shown, because the published definition wins. This is declared and matches the design note.
  • N3: The out-of-scope finding (?preview=draft becoming a create prefill pair) has no carrier. It is harmless as read, because the sanitizer drops an unknown key.

plugin-form maps the underscore-private _draftOnly marker onto a field's
disabled in ObjectForm and fromObjectSchema; the preview data source still
leaves such fields out of every write.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
@github-actions github-actions Bot added the tests label Nov 17, 2026
… the write census

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB

L1 delta review · 2026-11-17T14:16Z

L1: REWORK
Head-sha: 9719bf9

This is a delta from my ACCEPT 6949215692 at 1f101631. It supersedes that verdict. Read: the 2 new commits (11 files, +116/−28 over the old head; +665/−4 over the merge-base), amendment 6949282066 and report 6950546944. check-governed-merges: not governed, 669 lines.

CI on this sha at review time: 54 runs, none failed. Test UI (16 shards), Lint UI, Type Check UI and Build & E2E UI were still in progress.

Must-fix

  • M1: a draft-only field the draft declares required is now disabled but still required, so the form cannot be saved.
    • How it happens:
      • withDraftOnlyFields copies the draft definition as is ({ ...def, _draftOnly: true }), including required and requiredWhen.
      • In @object-ui/plugin-form, both changed sites keep required: isRequiredInForm(field, isCreateFormMode(…)) (ObjectForm.tsx ~:1004, sectionFields.ts ~:338), and the new condition lands only on disabled.
      • In the renderer, disabled does not lower required. form.tsx (renderFormField) reads disabled: fieldDisabled only for the control (:4218). resolveFieldRuleState gets required: staticRequired, and the required validator in rules.validate (:3863) runs regardless. FormField gets no disabled prop, so react-hook-form still validates the field.
    • Effect: under ?preview=draft, a draft that adds a required field with no default (the usual shape of an AI-built field) leaves New refused with "X is required" on a control the viewer cannot fill. This is the os serve <config> cannot boot without a prebuilt dist/objectstack.json — dies with Service 'manifest' is async - use await #4085 class: nothing the user can type unblocks the submit. Before this delta the field was editable, so the viewer could type and the value was stripped. The disabled route is what introduces it.
    • Measured or inferred: read from code at this head, not reproduced. A failing test settles it either way.
    • Fix: lower required and requiredWhen for a marked field. Either do it in plugin-form beside the disabled term at both sites (required: field._draftOnly === true ? false : isRequiredInForm(…), and no requiredWhen for it), or drop both keys from the marked copy in withDraftOnlyFields. Pin it with a draft-only field that is required: true with no default: Save goes through and the create payload has no such key. The fix itself is in surface; the plugin-form route is already covered by amendment 6949282066.

Should-fix

None. S1 from 6949215692 is fixed: the RecordFormPage comment now describes the drawn-disabled, write-stripped route and the raw-adapter claimAnswerWarnings. E1 is resolved by the seat's word at 13:21Z (amendment 6949282066).

Delta checklist

  • Shape: Part of #34807, Clause-②: no, Metadata-protocol: none. _draftOnly is spelled as a literal in each package, and nothing new is exported from either. The body and changeset call it an underscore-private convention between two repo packages, never an authoring key. That is consistent with amendment 6946712960's "internal undeclared key".
  • Surface:
    • ObjectForm.tsx and sectionFields.ts plus their tests are covered by amendment 6949282066.
    • affordanceGrantMap-12082.test.tsx gains two door(...) rows for the proxy's create/update. That is the write census's own ledger, forced by the new write sites (it was red at 03c259dc). The report names it, but I see no amendment line for it. N1.
    • No unrelated files.
  • Changeset: it now names @object-ui/plugin-form patch beside @object-ui/app-shell patch. These are the two packages whose src moved.
  • Comments and docs: the helper doc now cites filterSystemFields (it drops a readonly: true field before render, on create and edit alike) instead of filterCreateModeFields. The body and the AppContent and RecordFormPage comments match the shipped route.
  • Tests:
    • 5 files and 118 tests pass.
    • The real RecordFormPage+ObjectForm and the real ModalForm under preview assert input[name="priority"] disabled, title enabled and no priority in the payload.
    • ObjectForm.test.tsx and sectionFields.test.ts each pin a marked field disabled, with an unmarked control.
    • The ablation of the fromObjectSchema term turns 2 tests red, and the restore is reported.
    • None of the fixtures marks a draft-only field required, which is why M1 is not caught.
  • UI strings: none.

Notes

  • N1: Add affordanceGrantMap-12082.test.tsx to the claim's surface (an amendment line or the body's surface list). It is a census row the new write sites force.
  • N2: From the earlier review and still open, with no carrier: the ?preview=draft pair becomes a create prefill. It is harmless as read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB

L1 delta review · 2026-11-17T15:27Z

L1: ACCEPT
Head-sha: 75e7773

This is a delta from my REWORK 6950630501 at 9719bf98, and it supersedes that verdict. The delta is 2 commits (1bb765d4, 75e77738), 6 files, +133/−12. Read with reports 6951968909 and 6952444079. check-governed-merges: not governed, 792 lines.

CI on this sha was still in progress at review time. Land only once it is fully green.

Must-fix

None. M1 is fixed.

  • withDraftOnlyFields now drops required and requiredWhen from each _draftOnly copy. Both ObjectForm's field builder and fromObjectSchema read required and requiredWhen from that copy, so a disabled draft-only control is never required.
  • resolveSectionEntry closes the other way in: a form-view entry restating required is ignored when the base field carries _draftOnly === true. View entries carry no requiredWhen (sectionFields.ts reads it from the object field only, ~:372), so nothing else can re-require the field.
  • A published field keeps its own required and the view's required exactly as before.

Should-fix

None.

Delta checklist

  • Shape and surface: Part of #34807, Clause-②: no, Metadata-protocol: none. No new export: the _draftOnly literal is read once more, inside plugin-form. All touched files are inside the surface as amended by 6949282066.
  • Changeset: both package paragraphs now describe the dropped requirement, and the plugin-form paragraph describes the view-required exception. Still @object-ui/app-shell and @object-ui/plugin-form at patch.
  • Comments: the helper doc and withDraftOnlyFields doc say why the requirement is dropped. The resolveSectionEntry comment names the exception and its reason.
  • Tests: 5 files and 125 tests pass.
    • With the real ModalForm and the real RecordFormPage under preview:
      • a required draft-only field and a requiredWhen one are each disabled, Save goes through, and the create omits them;
      • a draft form view restating required does not block Save.
    • Unit pins cover the marked copy (required/requiredWhen dropped, published kept) and the view entry, with an unmarked control.
    • Control: outside preview, an empty required published field still blocks Save.
    • Two ablations: restoring the marker spread turns 3 tests red, and removing !draftOnly turns 2 red. The controls stay green both times.
  • UI strings: none.

Notes

  • N1, declared in the body: value rules (length, range and the like) stay on the marked copy. They fire only on a value, and a disabled draft-only control holds at most its draft default. If that default itself breaks the draft's own rule, it would surface as an error on a field the viewer cannot edit. That is an edge case with no pin, and it is not a blocker.
  • N2, from the last round and still open: name affordanceGrantMap-12082.test.tsx in the surface.
  • N3, from the first round and still open, with no carrier: ?preview=draft becomes a create prefill pair.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX

Landing · 2026-11-17T15:51Z · area o3-A

Probe Reading
check-governed-merges.mjs --pr 34843 NOT governed · 792 changed lines (+787/−5) ≤ 3000
L1 + checks on head 502c71571ad2b46f047522f13cea224a812dd77e L1-a delta ACCEPT 6952491933 at 75e7773, which supersedes REWORK 6950630501 (M1 fixed on both paths). L1-a carried it to this head: a clean main merge, --remerge-diff empty, the 11 PR files byte-identical. o3-A merged origin/main because the PR was 29 first-parent commits behind (K ≥ 15); overlap-check exit 0 · 53 check-runs: 40 success, 13 skipped, 0 failing · mergeable_state clean · main 0 commits ahead since

State: pr_ready + automerge_enable now. This is Part of #34807, so the card stays open and claimed: the list half (claude/issue-34807-draft-preview-list) opens its PR with Fixes #34807 after this merges. Merge standard: no open must-fix or should-fix. L1's three notes are nits:

  • N1 (a draft default that breaks the draft's own value rule surfaces on a field the viewer cannot edit) has a user effect and goes to the seat.
  • N2 (census file surface line) and N3 (?preview=draft as a create prefill pair, dropped by the write sanitizer) stay in the L1 record.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 15:51
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 13e0305 Nov 17, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34807-draft-preview-form-list branch November 17, 2026 16:15
os-support-ai pushed a commit that referenced this pull request Nov 17, 2026
…half

The form-half files resolve to main's squash, which carries rounds 3 and 4.

Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants